<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Sign in</title>

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/bootstrap.css" >
    <link rel="shortcut icon" href="http://twitter.github.io/bootstrap/assets/ico/favicon.png">
</head>

<body onload='document.f.j_username.focus();'>>
<div class="container">

    <form class="form-signin" name='f' action="<spring:url value='j_spring_security_check' />" method='POST'>
        <h2 class="form-signin-heading">Please sign in</h2>
        <input type="text" class="input-block-level" placeholder="Email address" name='j_username'>
        <input type="password" class="input-block-level" placeholder="Password" name='j_password'>
        <button class="btn btn-large btn-primary" type="submit">Sign in</button>
        <div class="pagination-centered">
            <a href="registration">Registration</a>
        </div>
    </form>
    <c:if test="${not empty error}">
        <div class="pagination-centered">
            Your login attempt was not successful, try again.<br/> Caused :
                ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
        </div>
    </c:if>

</div>

</body>
</html>